package com.home.dao;

import java.util.List;

import org.springframework.dao.DataAccessException;

import com.home.entity.User;

public interface UserDao {
	/**
	 * 添加用户
	 * @param user
	 * @return
	 * @throws DataAccessException
	 */
	public int addUser(User user)  throws DataAccessException;
	/**
	 * 通过密码 用户名查找用户
	 * @param username
	 * @param passsord
	 * @return
	 * @throws DataAccessException
	 */
	public User findUserByNameAndPassword(String username,String passsord)  throws DataAccessException;
	/**
	 * 通过邮箱 或者用户名登陆
	 * @param user
	 * @return
	 * @throws DataAccessException
	 */
	public User findUserByUser(User user)  throws DataAccessException;
	/**
	 * 查询所有User 集合
	 * @return
	 */
	public List<User> getAllUser() throws DataAccessException;
}
